Repository navigation
Conversation
Adds the `ci-test` profile (release optimisation with debug assertions and overflow checks, no fat LTO) and points `make test` at it, so the invariants release compiles out are checked by the suite. dotscope now requires analyssa 0.7.0.
`dotscope::io` exports the ECMA-335 compressed integer codecs, the endian readers and writers over `CilIO`, the 7-bit encoded length and the prefixed string writers. The signed compressed integer follows ECMA-335 instead of a zigzag form, and `write_compressed_int` returns `Result`. `repair_pe` and its result types are exported, `Parser::seek` accepts the end of the data, and `utils::RowList` keeps list entries under the rows they came from.
…points, sort order validation Lists that metadata rows attach to (custom attributes, generic parameters, interfaces, nested types, constraints, overrides) are RowLists read in table order, and `Resources` iterates in ManifestResource order, so a file loads the same way every time. Sequence points follow the Portable PDB format, array lower bounds are signed, sort order is validated, and `CilObject::resolve_method_declaring_type` resolves a call target's type. The loader checks its dependency graph for cycles in every build, with a test of the schedule against each loader's declared dependencies.
The decoder sets `Operand::Target(rva)` on every branch and `leave`. `decode_blocks_with_handlers` decodes a method from its exception handlers as well as its entry, `InstructionEncoder::emit_call` takes its argument count as `u16`, and `InstructionEncoder::instruction_count` gives the index of the next instruction.
…ces, x86 boundary construction The re-exported analyssa types take and return Fx maps and sets. `arglist`, `mkrefany`, `refanyval` and `refanytype` decompose to SSA and are typed. The x86 translator records each block's reads and writes and lets analyssa's boundary construction answer them, so a register read after a merge translates. `conv_op_for_target` is replaced by analyssa's `SsaOp::conversion_between`.
Code generation emits a block's operations in SSA order; a value read once moves to its use only where analyssa's FoldForest proves it unobservable, slots are shared by analyssa's Gathering and typed from every value they hold, and phi copies are one parallel copy per edge. Every generated body is checked by translation validation and against ECMA-335's protected-region rules, and refused bodies keep their original IL. `compile` is all or nothing, methods are emitted in token order, and strength reduction is analyssa's.
…a still names The change sets take savepoints, so a refused method's compilation rolls back the rows, heap entries and interning it added. Cleanup keeps every type that surviving metadata still names - member signatures, base types, interface lists, generic parameter constraints, TypeSpecs and local variables - which a call graph cannot see, instead of deleting it and leaving rows that point at whatever takes its row number.
The capture context records which method read which manifest resource, and override resolution compares parameter lists through `SignatureMethod::has_same_parameters`.
… transforms, safer passes A body the generator refuses is an `EventKind::CodegenRefused` event and keeps its original IL. Later byte transforms see what earlier ones restored, since each remaining technique is detected again first. Passes remove only instructions nothing reads, reflection and folding handle `callvirt`, name matching is exact, String folding is limited to System.String, and array data fields are named by interning order.
Follows the API changes: resources keyed by ManifestResource token, branch operands as targets, and the codec and signature changes.
…erEx samples The BitMono suite runs every test against both versions. Nine ConfuserEx samples (anti-debug, anti-dump, anti-ILDasm, harden, invalid metadata alone and with anti-tamper, reference proxy, rename, type scrambler) join the ConfuserEx suite as plain requirements. A missing BitMono sample or an unloadable original is a hard failure, the .NET Reactor native-EXE sample is no longer skipped, and two passing .NET Reactor string tests are no longer ignored.
`tests/samples/factory` builds the samples in Docker: ConfuserEx, BitMono, Obfuscar and JIEJIE.NET each run as their .NET Framework build under Wine (run on .NET Core they bound their injected code to that runtime, and most BitMono, Obfuscar and JIEJIE samples did not load). It also generates metadata layout and stream-directory experiments, debug-information forms and a .winmd, and runs every sample on the .NET Framework 4.8, CoreCLR and Mono (`oracle.tsv`). The README records the measured CLR rule for repeated stream headers and the cause of each sample that does not run.
… does Stream headers follow the rules measured on .NET Framework 4.8 and CoreCLR through the sample factory's oracle: any number of headers and names the runtime gives no stream are accepted, a repeated heap header resolves to the one the runtime reads, and what the runtime refuses is refused (a header past the metadata, a name over 32 bytes, two tables streams, #Schema before the tables). Root::stream, Root::tables_stream and Root::unread_streams expose the result. The #~ header's ExtraData word (HeapSizes 0x40) is skipped, and #JTD beside #- tables makes every index column four bytes wide: TablesHeader::from and TableInfo::new take wide_columns. A coded index whose tag names no table reads as the null reference, keeping its stored value in CodedIndex::unassigned_tag. Adds the factory's stream and layout samples and tests/stream_directory.rs, which holds dotscope to the CLR's verdict on each. Fixes #289 Refs #290
…ted rows An image holding a coded index whose tag names no table writes again, modified or not, so ConfuserEx's DeclSecurity row with no parent round-trips. A reference to a row the write deletes used to be remapped to the next surviving row, silently pointing it at another entry. It now fails the write with Error::DanglingReference naming the referrer, or is written as null under GeneratorConfig::with_dangling(DanglingPolicy::Null). A list column starting at a deleted row still starts at the next surviving one. Field RVA data is copied whatever its size, and the TypeDef, MethodDef and LocalScope builders start an omitted list column at the next row instead of at rows other entries own. Fixes #290
CustomAttributeRaw::to_owned takes the type registry and reads constructor arguments by the constructor's signature rather than its Param rows, which are optional: ConfuserEx's ConfusedByAttribute lost its argument. Param::from_signature lists every parameter a signature declares. The signature types gain type_tokens, every TypeDef, TypeRef and TypeSpec they name, custom modifiers included. Cleanup uses it, so a type named only through a modifier on an array or pointer element, a parameter, a local or a vararg is no longer deleted while signatures still name it. A type registry keyed assembly sources by the Assembly row token, 0x20000001 in every assembly, so in a project the first assembly registered claimed every other's types. Sources are keyed by the row itself.
Checks of the validators' own are removed: content scanning of security attributes, limits ECMA-335 does not set (argument counts, name lengths, overloads, blob and heap sizes, layout gaps), "suspicious" versions, generations, keys and sizes, and checks nothing can trigger. Validation no longer fails assemblies the runtime loads. Rules that rejected real assemblies are corrected: Assembly and AssemblyRef flags accept every defined bit, SHA384 and SHA512 are hash algorithms, value types are the types extending System.ValueType or System.Enum, and the row cap is the 24-bit token limit. Rules that never fired check what they name: ownership and dependency checks read external() as "imported" and skipped every type the assembly defines; unresolved types are found by resolution; inheritance depth no longer depends on where the walk starts; concrete types with abstract methods are found whether or not the base resolves; MethodDef signatures past the blob heap and field signatures on methods are reported; a change set's field list past the Field table or at 0 is reported.
…raphs A call through a MethodSpec, or a MemberRef naming a method of the assembly, is a call of that method in both the SSA and the effective call graph: CompilerContext::build_ssa_call_graph and build_effective_call_graph take the assembly to resolve them. ConfuserEx's type scrambler had its generic BuildMessage deleted while still called through such tokens.
…transforms Metadata repairs are one registry (deobfuscation::repairs) that both decides whether cleanup must run and applies them; ConfuserEx's invalid metadata is removed and its output passes validation. BitMono's embedded method tokens name rows of the module before BitMono renumbered it. bitmono.tokens resolves each by signature under one offset per type, so DotNetHook reversal no longer redirects 0.45 calls to the wrong methods, and a CallToCalli site whose anti-debug code separates the calli from its token is no longer missed. bitmono.locals reverses LocalVariableEncoding, and DotNetHook's dummies are the methods before its init methods. Every technique with a byte transform declares TechniqueCapability::ByteTransform, so cleanup withholds what a failed transform's technique would remove. <Module> members with Assembly access become Public, as the runtime enforces Private on global members.
src/test and tests/common become dotscope::testkit, reached by the unit tests as crate::testkit and by the integration tests through the hidden, unstable testkit feature, so both share one copy. Samples are reached through testkit::fixture, which fails a test whose sample is missing; tests/samples/MANIFEST.toml lists every sample with its hash, source and license, and its test fails on drift. Over 100 tests that returned early without their sample, and about 300 that asserted only if a load succeeded, now fail. Tests that need .NET tools ask testkit::tools::require_tool: without the tool they skip, or fail under DOTSCOPE_REQUIRE_TOOLS=1, which the Linux CI, coverage and release jobs set. Every tool runs through run_with_timeout. Validator tests state what each case must draw (Expect::Pass, Expect::fail, Expect::refused), a case the harness cannot set up fails, and the factories build cases that break exactly one rule.
… read Loading and typing: - Custom attribute enums that no loaded assembly defines take the size that ends the blob, so 72 Mono framework assemblies that were refused now load. The cap on named arguments is gone. - Overrides match by signature, and every Mono 4.8 and .NET 10 runtime assembly loads as one project. - Function pointers (unmanaged ones included), by-ref parameters, returns and locals, and a value type's `this` and constructed value are typed as what they are, so every corpus method lifts to SSA the verifier accepts. - A failing load names the first failing row or body in token order. Writing: - Signatures encode back to what they were read from. - The user string heap keeps "" and unpaired surrogates and follows ECMA-335's terminal byte, and heaps deduplicate by content. - Cleanup keeps every row a column can name, and renumbers only blobs a signature column references. - Table operations are ordered by a logical timestamp. Tests: - One integration binary in quick, full and oracle tiers, with no result depending on machine load. - A corpus sweep holds every manifest fixture to loading and lifting. A fixture malformed by design names the error it must be refused with. - Documentation examples are real, compiling code.
- PdbProbe images and PDBs (embedded, portable, release, unmapped and Visual Basic) and section layout probes, with their generators. - System.Reflection.Metadata goldens for the fixtures the manifest tags `srm`, the dumper that writes them and a Mono resource reader. - The manifest lists every new sample with its hash, source and license.
Formats: - Custom attribute values, marshalling descriptors, declarative security, method bodies and custom debug information follow the ECMA-335 and Portable PDB grammars, so each value encodes back to its bytes. - Security actions and permission flags take the runtime's values, XML permission sets are read as UTF-16, and binary sets keep their named arguments. - Signatures parse in one pass bounded by their bytes; the caps on parameters and generic arguments are gone. Loading: - Every load reads the PDB the image embeds or its own debug tables, and CilObject::pdb gives every table with queries; standalone PDBs attach. - Bytes at an RVA are read through one section map as the runtimes map them, the metadata version is its UTF-8 text, and native imports and exports are walked entry by entry as the Windows loader does. - StateMachineMethod rows load, other methods and declarative security keep every row, and nested generic instances keep their enclosing type. Writing: - An assembly written back unchanged holds what it held: method bodies past 8 MB, fat headers, shared string tails, debug directories and PDB blob columns survive a rebuilt heap. - `.resources` streams are written as ResourceWriter writes them, an index too wide for its column is refused, and change ids count per assembly. Analysis and emulation: - Class hierarchy analysis finds every override and implementation, the emulator charges native work to its budget and reads heap objects in place, and exception clauses come nested first in a stable order. The testkit gains property generators, codec and writer corpora, the oracle comparison and the fuzz entry points.
- New integration modules for Portable PDB loading and round trips, ReadyToRun images, `.resources` streams and section mapping. - The System.Reflection.Metadata oracle runs in the full tier. - Packer, corpus, codegen and runtime suites follow the new APIs. - docs/testkit.md describes the property generators, corpora and the oracle.
- benches/common/alloc.rs counts peak live bytes, allocations and bytes allocated through the binary's own allocator, so a measurement does not depend on machine load. - A workloads bench times writing back, SSA lifting, the deobfuscation pipeline, code generation, emulation, project loading, the call graph and the IL listing, each with what it allocates. - tests/allocations.rs checks that an emulated array loop allocates in proportion to the array.
- Fuzz targets wrap dotscope::testkit::fuzz, one per decoder, codec and pipeline stage, and run with debug assertions on one rayon thread under a LeakSanitizer suppression list. - Committed crash inputs live under fuzz-regressions/<target>/, and tests/fuzz_regressions.rs replays each through its own target under an allocation bound in the quick tier; tests/fuzzer.rs replays only a local corpus. - CI no longer fuzzes. `make fuzz` runs every target locally, and `make oracle-goldens` rewrites the oracle's goldens.
- A #Strings, #US or #Blob stream of no bytes reads as the sentinel heap: index 0 is the empty value and any other index is out of bounds. Mono's ilasm writes such heaps, and the heap writer, the table dump and the System.Reflection.Metadata oracle follow. - Array signatures, ReadyToRun's included, refuse rank 0 and more sizes or lower bounds than dimensions (II.23.2.13). A rank-1 general array is named `T[*]`, apart from the vector `T[]`. - CilType::enum_underlying gives the integer an enum is stored as. - Table row iterators split into tasks of 512 rows.
- A `.resources` entry of a serialized type keeps its payload as ResourceType::Serialized, decoded as a .NET Remoting binary (MS-NRBF) record stream where it is one. - Compiled XAML (BAML) records decode against the table of known WPF types, properties and assemblies, generated by baml/generate_known.py. - Fixtures: a localized WinForms form and a WPF window's .g.resources, declared in MANIFEST.toml.
- Calls are one SsaOp::Call carrying CallData and its Callee (direct, virtual, constrained or through a pointer); SsaOpCilExt::method_call and referenced_tokens read them. CIL prefixes are stated on the operation they prefix (CilPrefix) instead of standing as their own operations. - Evaluators, constant propagation and the value resolver take the target's Machine instead of a PointerSize. - The z3 solver translates typed unary and binary operations by their scalar semantics and states every operation as the value it computes; values the program leaves to the target are unconstrained. - An enum computes as its underlying integer on the evaluation stack (TypeProvider::enum_underlying). - Code generation emits calls as call, callvirt or calli by callee, and shares storage by what keeps two values apart.
- A rewired edge carries what the bypassed blocks computed for the values live past them, so cross-block values no longer spill to locals and the method is not rebuilt (spill.rs gives way to rewire.rs). - The state machinery left dead goes, and a write to a slot the method reads as storage is kept. - The dispatch table records the block each dispatched state leaves from.
- no_run examples across metadata, emulation, analysis, cilassembly and deobfuscation build what they read and assert their results, on the crate's own samples where they need an assembly. - Examples follow the current APIs.
- Short summaries grouped by area: breaking changes merged into one bullet per area, fixes into one or two lines per user-visible change. - Adds the work budget, emulation limits, IR, resource decoding, array signature and unflattening changes.
Bump dotscope and dotscope-cli dependencies to their latest stable releases, including toml 0.9 -> 1.2 and z3 0.21 -> 0.23, and refresh the fuzz lockfile.
Names read from #Strings share one copy of their run (SharedStr), a Document's name and hash view one copy of #Blob (DocumentName, SharedBytes), and a type's full name is a FullName that links to its enclosing type's instead of being joined while loading. A type's field, property, event and modifier lists, ParamList and a method's locals are LazyLists allocated on first push, and a strong name's key is an Arc<[u8]>. Loading the 1017-assembly corpus takes 25% less time, a third less peak memory and 36% fewer allocations. List columns are read once per table into runs clamped to their table (MemberRanges), so a hostile column no longer costs billions of iterations; the raw to_owned of the list-owning rows takes them. A method's code type is compared as the two-bit field it is (is_code_il held for every method; Method::code_kind, MethodCodeKind, code_rva), a modified type holds the type its modifiers prefix, DLL names compare ignoring case, CilObject::from_view returns a ViewLoadError that keeps the view, and the table loaders move behind the loader module.
A panic while loading an assembly no longer hangs ProjectLoader::build. A dependency that fails or panics is left out and reported in failed_loads, the primary failing fails the build, strict_mode fails on a missing or failing dependency, and missing_dependencies lists only names not found. Dependency names from AssemblyRef rows must be simple file names that resolve inside their search directory; each file is read once and max_assemblies bounds a build. A TypeRef binds in the assembly its AssemblyRef names, and CilProject lists its assemblies in identity order.
FlowType gains CallIndirect and MethodJump, both Call before, and Instruction::fall_through / FlowType::falls_through say where control continues. The decoder ends a block at jmp, and code the runtime refuses (ECMA-335 III.1.7.5: falling off the end, a branch into an operand, a join at two stack depths) fails the lift instead of producing SSA nothing accepts. The runtime handle types are resolved once per method. The x86 lift of native stubs follows the processor's flags, partial registers, MUL/DIV, extensions, shifts and rotates, and refuses what it cannot state exactly, 64-bit code included. A conversion chain is shortened only where the inner conversion keeps the value, and codegen lets a value share an argument's slot after its last read.
A write that renumbers rows or replaces bodies regenerates the Portable PDB the image embeds and the debug directory entries naming it, and in-image debug tables follow the methods it deletes, replaces and adds (#291). Placeholders and appended strings are found through indexes built for the write instead of a scan per entry (8000 new types: about 9x fewer instructions; 20000 renamed strings: about 125x), renaming a string no longer compacts the heaps, and the tails inside a renamed or merged string follow it. Every exception clause of a rewritten body is kept. Cleanup decides which types go before deleting members, deletes nested types at every depth and keeps the enclosing chain of a survivor. MethodBuilder declares P/Invoke, internal-call and runtime-implemented methods and refuses any other bodyless method.
…ings Heap objects and statics sit behind Arc and are copied on the first write after a fork; hooks read them shared. An array index is an integer, and ldfld/stfld through a field pointer reach the struct. Hook results are checked against the method's signature, newobj pushes what a constructor hook constructs, a delegate's Invoke through a MemberRef dispatches, a bound target is passed and a multicast delegate returns to its caller. An Assembly.Load'ed assembly runs against its own metadata, and the template maps the original PE once. Strings are measured in UTF-16 code units (O(1) Length and Chars), DateTime is real and deterministic for Repro builds, and symmetric crypto, CryptoStream and compression throw the runtime's exceptions instead of handing their input back.
A state-machine decryptor call with no seed found is not decrypted (seed 0 stood in), the state machine stays while a failed call site reads it, decrypted values are cached per generic instantiation, and opaque-field folding takes only fields never stored at runtime. A byte transform that failed, found nothing or is superseded no longer reruns the pipeline, and engine runs no longer share one technique order. NecroBit reads each restored body through a window the size of the body and checks a heap array's header before copying it, and the .NET Reactor trial checks are bypassed in every emulation the pipeline runs.
The smart-rename feature (dotscope and dotscope-cli), SmartRenameConfig, CleanupConfig::smart_rename and the CLI's --rename-ai are removed, and with them the mistralrs and tokio dependencies. Cleanup renames obfuscated identifiers to sequential names as before.
Quoted strings and names share one escaper (constants, P/Invoke modules, cultures and assembly, module, file and resource names were written unescaped), and a user string that is not valid UTF-16 is written as a bytearray. Floats are the shortest decimal that reads back the same, and infinities, NaN and negative zero are written as their bits. A general array keeps its bounds, and .locals comes from the parsed signature (T& pinned). A local signature token is read only as a StandAloneSig token (MethodBody::local_var_sig_rid).
Every packer sample is deobfuscated twice, in pools of one and eight threads, and the outputs must be byte-identical. New coverage for PDB regeneration, heap rewriting and cleanup's keep set; codegen tests name the instructions they expect; the allocation benchmarks count per workload; the testkit, examples and CLI follow the API changes.
deny(unnameable_types): every type the public API takes, returns or holds is re-exported beside the API that hands it out, and internal items take their reach from private modules instead of restricted visibility. CI and the release build the docs with --document-private-items, which is what the internal links need.
Both manifests and both lockfiles, the dependency quoted in README and the crate docs, and the changelog condensed into the 0.10.0 section. Two doc comments named functions that are gone. The lockfiles resolve analyssa 0.7.0 from the local path until it is published; the remote build needs that release first.
Copy propagation, dead-method elimination and the algebraic test call the pass structs analyssa 0.7.0 publishes and hand them a PassEnv, instead of the free functions it no longer exports. Two predicates read as one expression and a redundant #[must_use] on a boxed iterator goes.
Both lockfiles take the published analyssa 0.7.0 with its checksum instead of the local path it was resolved from before the release.
EngineConfig::target_obfuscator and with_target_obfuscator promised to bypass detection, but nothing has read the field since it was added: setting it changed nothing. Attribution only reports, and techniques need what detection finds, so there is nothing for it to steer.
The release is dated, the unassigned coded index fix and the debug directory change name their tickets, the removed target_obfuscator joins the configuration nothing read, and doc tests move under Tests.
The lift states each widening of an 8- or 16-bit value to the int32 the stack holds as a conversion, reads a conversion's operand at its own width, and truncates a store into a narrower slot. A block that returns, throws or ends a handler passes no stack on. Code generation keeps every narrow value in its stack form, re-extends an operand an operation reads in the other window, and emits nothing for a widening the stack already holds. The BitMono local decoder reads through that widening.
… variable's type A conversion is a copy only where the stack holds source and target alike, and a widening chain folds only where one conversion computes both. A folded constant is written in the type of the variable it defines, and a folded branch drops the phi operands of the edges it removes, which left invalid SSA where an edge led straight to a join.
…ation Random methods over every integer width are lifted, optimised and regenerated, and each body runs in a strict interpreter of its CIL; a pass whose output computes otherwise, refuses or types a constant wrongly is a defect.
MANIFEST.toml hashes every sample and the PDB fixtures embed and checksum their sources, so a checkout that converts line endings, as Windows does by default, makes them disagree with the files on disk.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A correctness release built on analyssa 0.7.1. Every assembly of the test corpus loads, lifts
to SSA the verifier accepts and writes back holding what it held; generated code is
translation-validated; and the public API changed wherever it could not state what the
metadata means, so this release has many breaking changes.
Changed
SsaOp::CallholdingCallDataand its
Callee(read throughSsaOpCilExt::method_call), CIL prefixes sit on theoperation they prefix (
CilPrefix), evaluators take aMachineinstead of aPointerSize, a float constant isConstValue::Float(FloatBits)andEmValueconvertsfrom a
ConstValuewithTryFrom.where that is unobservable, shares slots and makes one parallel copy per phi edge. Every
generated body is translation-validated (
compiler::validate_lift); a refused one keepsits IL (
EventKind::CodegenRefused).SsaCodeGenerator::compileis all or nothing andgenerate_with_assemblyis removed.EngineConfig::budgetbounds everypass and the scheduler (
with_budgetreplaceswith_max_iterations),EmulationConfig::limitsis the oneEmulationLimits(ProcessBuilder::with_limits) andEngineConfig::unflatteningthe oneUnflattenConfig.runtime loads validate.
security, method bodies, signatures, sequence points and custom debug information follow
the ECMA-335 and Portable PDB grammars.
lower peak memory and 36% fewer allocations. Names read from
#Stringsshare one copy(
SharedStr; aDocument's name is aDocumentName, its hashSharedBytes) and arereturned shared,
CilType::fullname()returns aFullName, and per-type lists areallocated on first push.
FlowType::CallIndirect(calli) andMethodJump(jmp), bothCallbefore;
Instruction::fall_throughandFlowType::falls_through; a branch operand isOperand::Target(rva).CilObject::from_viewandfrom_view_with_validationreturn aViewLoadErrorthat keeps the view; a coded index whose tag names no table reads as null
(
TableInfo::decode_coded_indexreturnsOption, [Bug]: CilAssembly::to_memory refuses an assembly the reader loads: one table row whose coded index names no table #290).FieldList,PropertyList,EventListandmodifiers,ParamListand
Method::local_varsareLazyLists, and attached lists (Property::fn_other,Event::fn_on_other,security) areRowLists;Identity::PubKey/EcmaKeyhold anArc<[u8]>andIdentity::Tokenis in .NET's byte order; custom attribute values holdOptionfor null, aBoxedargument andFieldOrPropType;MarshallingInfois onenative type;
SecurityActionandSecurityPermissionFlagstake the runtime's values;CustomDebugInfois decoded by kind;SignatureMethodgainsunmanaged;TypeSignature::ModifiedRequired/ModifiedOptionalhold the type they modify; thecompressed integer writers return
Result;Resourcesis keyed by token; the rawto_ownedof TypeDef, MethodDef, EventMap, PropertyMap and LocalScope rows takes thetable's
MemberRanges.Error::DanglingReference(oris null under
DanglingPolicy::Null) instead of moving to the next row.ManagedHeap::iteryieldsArc<HeapObject>, hook results are checkedagainst the method's signature,
NewObjResolution::HookedBypasscarries the valuenewobjpushes, andMethodBuilder::buildrefuses a bodyless method that is notP/Invoke, internal-call or runtime-implemented.
Added
CilObject::pdb()gives every table with queries, andwith_pdb/with_pdb_bytesattacha standalone
.pdb..resourcesvalues of user types are kept (ResourceType::Serialized) and read as MS-NRBF(
resources::nrbf); compiled XAML reads as a BAML document (resources::baml).Root::streamandunread_streams,Param::from_signature,type_tokenson signatures,TokenResolver::generic_definition,CilAssembly::find_corelib_type,CilObject::fieldsandcustom_attributes,CilType::enum_underlying,MemberRanges(TablesHeader::member_rangesandmember_rids),PdbStream::to_bytes, andMethod::code_kind/MethodCodeKind/Method::code_rva.dotscope::io(the binary codecs), SSA forms forarglist,mkrefany,refanyvalandrefanytype, and the hidden, unstabletestkitfeature.CilObject::from_project,CilAssemblyView::load_with_validation,assembly::decode_method,CustomAttributeParser,TokenResolver::new, ...), and every type the public API takes, returns or holds can beimported (
deny(unnameable_types)keeps it so).bitmono.tokens,bitmono.localsandnetreactor.emptyresource, a metadatarepair registry, and exports of
repair_pe, unflattening and the conflict resolution types.Removed
smart-renamefeature (dotscope and dotscope-cli),SmartRenameConfig,CleanupConfig::smart_rename, the CLI's--rename-aiand themistralrsandtokiodependencies. Cleanup renames to sequential names as before.DecryptorHeuristics,UnflatteningThresholds,detection_threshold,verify_semantics,resolution_strategies,EngineConfig::target_obfuscatorandwith_target_obfuscator),analysis::conv_op_for_target,Method::varargs,Method::is_forwarded_pinvoke(alwaysfalse;
Method::is_forward_refis theForwardReftest),AssemblyChanges::referenced_string_offsets(nothing read it), the public table loadersand the
skip-expensive-testsfeature.Fixed
Loading and metadata
#~ExtraData word,#JTDtables, any metadata version text, zero-length heaps and ConfuserEx's "invalid metadata"
(ConfuserEx
invalid metadataassemblies the CLR loads are refused or misread: stream directory over six headers, andHeapSizesbit0x40extra data in#~#289); bytes at an RVA are read through one section map.misparse what follows them. Custom attribute arguments are read by the constructor's
signature and enums by their underlying type.
timing, and Portable PDB data, sequence points and StateMachineMethod rows load as the
compilers write them.
ignoring case.
is_code_ilheld for everymethod).
no longer costs billions of iterations or quadratic memory.
Project loading
ProjectLoader::build; a dependency that fails isleft out and reported in
failed_loads,strict_modefails on a missing or failing one,and
missing_dependencieslists only names not found. Dependency names must be simple filenames resolving inside the search directory, and
max_assembliesbounds a build.CilProjectlists itsassemblies in identity order.
ILAsm output
is not valid UTF-16 is written as
bytearray, floats round-trip, general arrays keep theirbounds and
.localscomes from the parsed signature.Write path and cleanup
heap tails, user strings, the debug directory, every exception clause, and the native
import and export tables. A row whose coded index tag names no table (ConfuserEx's "invalid
metadata") no longer fails the write ([Bug]: CilAssembly::to_memory refuses an assembly the reader loads: one table row whose coded index names no table #290).
bodies regenerates the embedded Portable PDB and the entries naming it, and in-image debug
tables follow the methods it deletes, replaces and adds; a write that does neither keeps
the CodeView entry of a standalone PDB, which still matches the output.
replaced bodies follow a moved user string heap, and renamed strings keep their tails.
Writes no longer scan every change per placeholder or string (adding 8000 types: about 9x
fewer instructions; 20000 renamed strings: about 125x).
the enclosing chain of a surviving one;
add_cleanupnarrows earlier requests instead ofresetting them.
.resourcesstreams are written asResourceWriterwrites them, andrepair_perepairsany directory count past 16.
Analysis and code generation
underlying integer,
.locals initlocals read zero), and code the runtime refuses (fallingoff the end, a branch into an operand, a join at two stack depths) is an error.
type, drops the phi operands of the edges a folded branch removes, pure-call folding needs
a pure callee, and the
z3solver states every operation as the value it computes.int32the evaluation stack holds ([Bug]: SsaCodeGenerator skips certain SSA variables #288):the lift states each widening as a conversion, a conversion reads its operand at its own
width, a store into a narrower slot truncates, and generated code keeps every narrow value
in its stack form. Comparisons, remainders, phis and address offsets over mixed widths
are no longer folded wrongly.
extensions, shifts and rotates), so a stub it cannot follow stays native.
calli,typed element access and values leaving a
trythrough itsfinally, and a filter endsat its
endfilter.inheritance cycles and order callees first.
Emulation
base method's hook (a user
ToString, a CryptoStream read throughStream.Read).Arcand are copied on the first write after a fork;an array index is an integer;
ldfld/stfldthrough a field pointer reach the struct.newobjpushes what aconstructor hook constructs, delegates dispatch through a MemberRef
Invoke, pass theirtarget and return multicast calls to the caller, and an
Assembly.Loaded assembly runsagainst its own metadata.
conv.ovf.*opcodes,no., float comparisons on NaN,Math.Roundandstrings (UTF-16 code units, O(1)
LengthandChars) behave as in .NET; symmetriccrypto, CryptoStream and compression throw the runtime's exceptions instead of returning
their input.
Deobfuscation
and rebuilding the method.
(
EventKind::PassFailed), and a byte transform that found nothing no longer reruns thepipeline.
reads, caches values per generic instantiation, and folds opaque fields only from detected
fields never stored at runtime.
samples get their resources and
typeofs back.Tests
assembly must load and every method lift, and no verdict depends on machine load. Packer
samples are checked by what they print under Mono and deobfuscated twice to byte-identical
output, the System.Reflection.Metadata oracle compares every corpus assembly, failing fuzz
inputs are replayed as regression tests, benchmarks measure time and memory, and every
documentation example compiles and runs as a doc test. Random mixed-width methods are
lifted, optimised and regenerated against an interpreter of their CIL.
Dependencies
analyssa0.6.0 → 0.7.1,z30.21.0 → 0.23.0,iced-x861.21.0 → 1.22.0, and patchupdates of the rest.
mistralrsandtokioremoved;tomlandproptestare optional, fortestkit.